<?php
namespace model;
use \hc\pageajax;
use \hc\page;
class model_m{
  public function page_show($pagesize=10,$pagecount){
		//分页
		if(isset($_GET)){
			$search_arr=$_GET;
			unset($search_arr['page']);
			$search_str=http_build_query($search_arr);
		}
		if($search_str){//判断是否有其他参数
			$web_url=MOTHED_URL.'?'.$search_str.'&page=';
		}else{
			$web_url=$preurl.'?page=';
		}
		$this->page=new page();
		$this->page->var_url($web_url);
		$this->page->init($pagesize,$pagecount);
		$this->page->setConfig('a_pre',"上一页");
		$this->page->setConfig('a_nex',"下一页");
		$this->page->setConfig('a_total','');
		$pageshow=$this->page->show_page();
		return $pageshow;
	}
	/**
	* ajaxpage
	* 注意其他参数查询
	* @param undefined $pagesize每页显示条数
	* @param undefined $pagecount 总条数
	*
	* @return
	*/
	public function pageajax_show($pagesize=10,$pagecount){
		$this->page=new pageajax();
		$this->page->init($pagesize,$pagecount);
		$this->page->setConfig('a_pre',"上一页");
		$this->page->setConfig('a_nex',"下一页");
		$this->page->setConfig('a_total','');
		$pageshow=$this->page->show_page();
		return $pageshow;
	}
}
?>
